<template>
  <div>
      <p>正在登录中请稍等................</p>
      <p>{{code}}</p>
  </div>
</template>

<script>
export default {
    data(){
        return {
            code:this.$route.query.code
        }
    },
    mounted(){
        this.axios.get("http://127.0.0.1:8000/weibo?code="+this.code).then(resp=>{
            console.log(resp)
            if(resp.data.code==200){
                alert("微博登录成功")
            }else{
                alert("请继续绑定本地账号")
                this.$router.push({"path":"/bind","query":{"uid":resp.data.uid}})
            }
        }).catch(error=>{
            console.log(error.response)
            alert("微博登录失败")
        })
    }
}
</script>

<style>

</style>